<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Car;

use App\Models\Order;


class PaymentController extends Controller 
{

   

   public function paymentInfo(Request $request)
   {        
   		$rs['status'] = 'success';	
       	if($request->order_id){
       		$order=Order::find($request->order_id);
            if($order){

               $order->payment_status='paied';
               $order->status = 100;
               $order->save();             

            }
       		$rs['msg'] = 'Pyament has been done';    
       		return redirect('mybooking')->with('rs',$rs);

       }
       	$rs['status'] = 'danger';
        $rs['msg']    = 'Payment has failed';
        return redirect('mybooking')->with('rs',$rs);

       

   }

}